/*
 * @Author: lizhijie429
 * @Date: 2021-08-10 18:28:44
 * @LastEditors: lizhijie429
 * @LastEditTime: 2021-08-21 09:43:04
 * @Description:
 */

import { createRouter, createWebHashHistory } from "vue-router";
import Layout from "@/layout/index.vue";
import Home from "@/views/home/index.vue";
import Login from "@/views/login/index.vue";

const routes = [
  {
    path: "/login",
    name: "login",
    component: Login,
  },
  {
    path: "/",
    component: Layout,
    redirect: "/home",
    children: [
      { path: "/home", name: "home", component: Home },
      {
        path: "/about",
        name: "about",
        component: () => import(/* webpackChunkName: "group-user" */ "@/views/about/index.vue"),
      },
      {
        path: "/menu",
        name: "menu",
        component: () => import(/* webpackChunkName: "group-user" */ "@/views/menu/index.vue"),
      },
      {
        path: "/user",
        name: "user",
        component: () => import(/* webpackChunkName: "group-user" */ "@/views/user/index.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
